package com.yingxin.yxerp.module.tplus.auth.controller;


import com.yingxin.yxerp.module.tplus.auth.mapper.AuthMapper;
import com.yingxin.yxerp.module.tplus.auth.service.IAuthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * tplus-鉴权 前端控制器
 * </p>
 */

@Api(tags = "tplus-鉴权")
@RestController
@RequestMapping("/tplus/auth")
public class AuthController {

    @Autowired
    private IAuthService authService;

    @SuppressWarnings("all")
    @Autowired
    private AuthMapper authMapper;

    @ApiOperation(value = "临时授权码换token")
    @GetMapping("/code")
    public void getToken(@RequestParam String code) {
        authService.tokenRequestByCode(code);
    }


//    @ApiOperation(value = "刷新token")
//    @GetMapping("/refreshToken")
//    public void refreshToken() {
//        authService.refreshToken();
//    }
}
